package com.probiz.estore.customer.dao.impl;

import com.probiz.estore.customer.dao.ConsultVoteDao;
import com.probiz.estore.common.model.customer.ConsultVote;
import com.probiz.estore.core.dao.impl.HibernateGenericDaoImpl;

/**
 * Dao implementation for ConsultVote.
*/
public class ConsultVoteDaoImpl extends HibernateGenericDaoImpl<ConsultVote> implements ConsultVoteDao {
	/*
	 * (non-Javadoc)
	 * @see com.probiz.estore.customer.dao.ConsultVoteDao#isVoteAlready(java.lang.Integer, java.lang.Integer)
	 */
	public boolean isVoteAlready(Integer consultId, Integer customerId){
		String hql="from ConsultVote cv where cv.consult.consultId=? and cv.appUser.appuserId=?";
		long count=countByHql(hql, new Object[]{consultId,customerId});
		return count>0;
	}
}
